var fh = document.querySelector("#fh");

window.onscroll = function(){
   console.log(document.documentElement.scrollTop);

    if(document.documentElement.scrollTop > 1000){
        fh.style.display = "block";
    }else {
        fh.style.display = "none";
    }
};

fh.addEventListener('click',function(){
   // window.scrollTo(0,0);

    window.scrollTo({
        top:0,
        behavior:'smooth'
    })

});